Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Why does this throw "Cannot return null for non-nullable field Query.hello."?

I had a GraphQL server that I swear worked just a few weeks ago, but now, it's suddenly throwing "cannot null non-nullable field" errors.

Yes, I have checked for duplicates. Yes, I have googled it. Yes, I have checked for related GitHub issues.

I created a minimal repro here: https://stackblitz.com/edit/graphql-drkgtc?file=index.js. Either I'm tired, or there's some breaking change in a minor package version somewhere that I missed.

Does anyone have an idea what is going on here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this object for root variable:

var root = {
  Query: {
    hello:() => {return {hello :'hello'}}
  }
};

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!